import { http } from '@/utils/http/axios';

/**
 * 获取tree菜单列表
 * @param params
 */
export function merchantCategoryTree(params?) {
  return http.request({
    url: '/merchant/categories/tree',
    method: 'GET',
    params,
  });
}

/**
 * 添加菜单
 * @param params
 */
export function addMerchantCategory(params?) {
  return http.request({
    url: '/merchant/categories',
    method: 'POST',
    params,
  });
}

/**
 * 编辑分类
 * @param params
 */
export function editMerchantCategory(params?) {
  return http.request({
    url: `/merchant/categories/${params.id}`,
    method: 'PUT',
    params,
  });
}

/**
 * 获取分类
 * @param id
 */
export function merchantCategoryInfo(id) {
  return http.request({
    url: `/merchant/categories/${id}`,
    method: 'GET',
  });
}

/**
 * 删除分类
 * @param params
 */
export function deleteMerchantCategory(id) {
  return http.request({
    url: `/merchant/categories/${id}`,
    method: 'DELETE',
  });
}
